using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Framework;

namespace Framework.Interop
{
	[ComImport,
	 Guid("93F2F68C-1D1B-11d3-A30E-00C04F79ABD1"),
	 InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
	 CLSCompliant(false)]
	public interface IShellFolder2 : IShellFolder
	{
		/* IShellFolder members */

		new void ParseDisplayName([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Win32WindowMarshaler))] IWin32Window hwnd, [In] IntPtr pbc, [In, MarshalAs(UnmanagedType.LPWStr)] string pwszDisplayName, [In] IntPtr pchEaten, [Out, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ItemIDListMarshaler))] out ItemIDList ppidl, [In] IntPtr attrs);
		new void EnumObjects([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Win32WindowMarshaler))] IWin32Window hwnd, [In] EnumOptions grfFlags, [Out, MarshalAs(UnmanagedType.Interface)] out IEnumIDList ppenumIDList);
		new void BindToObject([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ItemIDListMarshaler))] ItemIDList pidl, [In] IntPtr pbc, [In] ref Guid riid, [Out] out IntPtr ppv);
		new void BindToStorage([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ItemIDListMarshaler))] ItemIDList pidl, [In] IntPtr pbc, [In] ref Guid riid, [Out] out IntPtr ppv);
		[PreserveSig] new int CompareIDs([In] int lParam, [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ItemIDListMarshaler))] ItemIDList pidl1, [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ItemIDListMarshaler))] ItemIDList pidl2);
		new void CreateViewObject([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Win32WindowMarshaler))] IWin32Window hwndOwner, [In] ref Guid riid, [Out] out IntPtr ppv);
		new void GetAttributesOf([In] uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] IntPtr[] apidl, [In, Out] ref FolderAttributes rgfInOut);
		new void GetUIObjectOf([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Win32WindowMarshaler))] IWin32Window hwndOwner, [In] uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] IntPtr[] apidl, [In] ref Guid riid, [In, Out] IntPtr rgfReserved, [Out] out IntPtr ppv);
		new void GetDisplayNameOf([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ItemIDListMarshaler))] ItemIDList pidl, [In] NameOptions uFlags, [Out] out StrRet pName);
		new void SetNameOf([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Win32WindowMarshaler))] IWin32Window hwnd, [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ItemIDListMarshaler))] ItemIDList pidl, [In, MarshalAs(UnmanagedType.LPWStr)] string pszName, [In] NameOptions uFlags, [In, Out] ref IntPtr ppidlOut);

		/* IShellFolder2 members */

		void GetDefaultSearchGUID([Out] out Guid pqguid);
		void EnumSearches([Out] out IEnumExtraSearch ppenum);
		void GetDefaultColumn([In] uint dwRes, [Out] out ulong pSort, [Out] out ulong pDisplay);
		void GetDefaultColumnState([In] uint iColumn, [Out] out ColumnStates pcsFlags);
		void GetDetailsEx([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ItemIDListMarshaler))] ItemIDList pidl, [In] ref SHColumnID pscid, [Out, MarshalAs(UnmanagedType.Struct)] out object pv);
		void GetDetailsOf([In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ItemIDListMarshaler))] ItemIDList pidl, [In] uint iColumn, [Out] out ShellDetails psd);
		void MapColumnToSCID([In] uint iColumn, [In] ref SHColumnID pscid);
	}
}
